# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=golang-gopkg-yaml.v3
pkgver=3.0.1
pkgrel=1
pkgdesc='YAML support for the Go language'
arch=('any')
url="https://github.com/go-yaml/yaml"
license=('Apache')
depends=('go')
checkdepends=('golang-gopkg-check.v1')
source=("$pkgname-$pkgver.tar.gz::https://github.com/go-yaml/yaml/archive/v$pkgver.tar.gz")
sha512sums=('32a5eab7fd45324a4c6be9465a09419f0cf5b142e8bd4a7c6c115162eb6df2d31564f8103e1c592b4a4bd19abd218533ba6d6d438b157dba0fcd353264e1c8ff')

check() {
  export GOPATH="$srcdir/build:/usr/share/gocode"
  export GO111MODULE=off
  mkdir -p "$srcdir"/build/src/gopkg.in
  cp -a "$srcdir"/yaml-$pkgver "$srcdir"/build/src/gopkg.in/yaml.v3
  cd "$srcdir"/build/src/gopkg.in/yaml.v3
  go test -v $(go list ./...)
}

package() {
  mkdir -p "$pkgdir"/usr/share/gocode/src/gopkg.in
  cp -a "$srcdir"/yaml-$pkgver "$pkgdir"/usr/share/gocode/src/gopkg.in/yaml.v3
}
